package com.eurobcoin.model;

import java.io.Serializable;
import java.util.List;
import java.util.Locale;

import com.eurobcoin.helper.NumberHelper;
import com.eurobcoin.trading.TradingOrder;

public class IndexPageModel implements Serializable {

	private static final long serialVersionUID = 2154392361317656805L;

	private int leftCurrencyId;
	
	private String leftCurrencyCode;
	
	private long leftCurrencyAmount;
	
	private int leftCurrencyDecimals;
	
	private int rightCurrencyId;
	
	private String rightCurrencyCode;
	
	private long rightCurrencyAmount;
	
	private int rightCurrencyDecimals;
	
	private long priceMin;
	
	private long priceMax;
	
	private Locale locale;
	
	private List<TradingOrder> buyOrders;
	
	private List<TradingOrder> sellOrders;
	
	public List<TradingOrder> getBuyOrders() {
		return buyOrders;
	}

	public void setBuyOrders(List<TradingOrder> buyOrders) {
		this.buyOrders = buyOrders;
	}

	public List<TradingOrder> getSellOrders() {
		return sellOrders;
	}

	public void setSellOrders(List<TradingOrder> sellOrders) {
		this.sellOrders = sellOrders;
	}

	public String getPriceMinFormatted() {
		return NumberHelper.longToDoubledString(
				this.priceMin, 
				this.rightCurrencyDecimals, 
				this.locale);
	}
	
	public String getPriceMaxFormatted() {
		return NumberHelper.longToDoubledString(
				this.priceMax, 
				this.rightCurrencyDecimals, 
				this.locale);
	}
	
	public String getLeftAmountFormatted() {
		return NumberHelper.longToDoubledString(
				this.leftCurrencyAmount, 
				this.leftCurrencyDecimals, 
				this.locale);
	}
	
	public String getRightAmountFormatted() {
		return NumberHelper.longToDoubledString(
				this.rightCurrencyAmount, 
				this.rightCurrencyDecimals, 
				this.locale);
	}
	
	public Locale getLocale() {
		return locale;
	}

	public void setLocale(Locale locale) {
		this.locale = locale;
	}

	public int getLeftCurrencyDecimals() {
		return leftCurrencyDecimals;
	}

	public void setLeftCurrencyDecimals(int leftCurrencyDecimals) {
		this.leftCurrencyDecimals = leftCurrencyDecimals;
	}

	public int getRightCurrencyDecimals() {
		return rightCurrencyDecimals;
	}

	public void setRightCurrencyDecimals(int rightCurrencyDecimals) {
		this.rightCurrencyDecimals = rightCurrencyDecimals;
	}

	public int getLeftCurrencyId() {
		return leftCurrencyId;
	}

	public void setLeftCurrencyId(int leftCurrencyId) {
		this.leftCurrencyId = leftCurrencyId;
	}

	public String getLeftCurrencyCode() {
		return leftCurrencyCode;
	}

	public void setLeftCurrencyCode(String leftCurrencyCode) {
		this.leftCurrencyCode = leftCurrencyCode;
	}

	public long getLeftCurrencyAmount() {
		return leftCurrencyAmount;
	}

	public void setLeftCurrencyAmount(long leftCurrencyAmount) {
		this.leftCurrencyAmount = leftCurrencyAmount;
	}

	public int getRightCurrencyId() {
		return rightCurrencyId;
	}

	public void setRightCurrencyId(int rightCurrencyId) {
		this.rightCurrencyId = rightCurrencyId;
	}

	public String getRightCurrencyCode() {
		return rightCurrencyCode;
	}

	public void setRightCurrencyCode(String rightCurrencyCode) {
		this.rightCurrencyCode = rightCurrencyCode;
	}

	public long getRightCurrencyAmount() {
		return rightCurrencyAmount;
	}

	public void setRightCurrencyAmount(long rightCurrencyAmount) {
		this.rightCurrencyAmount = rightCurrencyAmount;
	}

	public long getPriceMin() {
		return priceMin;
	}

	public void setPriceMin(long priceMin) {
		this.priceMin = priceMin;
	}

	public long getPriceMax() {
		return priceMax;
	}

	public void setPriceMax(long priceMax) {
		this.priceMax = priceMax;
	}
	
}
